inherited crdIncompleteAct: TcrdIncompleteAct
  Left = 419
  Top = 188
  Width = 506
  Height = 450
  BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp]
  Caption = #1050#1072#1088#1090#1086#1095#1082#1072' '#1072#1082#1090#1072' '#1085#1077#1076#1086#1087#1086#1089#1090#1072#1074#1082#1080
  Constraints.MinHeight = 450
  Constraints.MinWidth = 450
  OldCreateOrder = True
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel1: TPanel
    Top = 396
    Width = 498
    inherited BitBtn1: TBitBtn
      Left = 291
    end
    inherited BitBtn2: TBitBtn
      Left = 393
    end
  end
  inherited ToolBar1: TToolBar
    Width = 498
  end
  object GroupBox2: TGroupBox [2]
    Left = 0
    Top = 249
    Width = 498
    Height = 147
    Align = alClient
    Caption = ' '#1044#1086#1075#1086#1074#1086#1088#1099' '
    TabOrder = 2
    object dbgDogovors: TDBGridEh
      Left = 2
      Top = 39
      Width = 494
      Height = 106
      Align = alClient
      DataGrouping.GroupLevels = <>
      DataSource = dsc_Dogovors
      Flat = True
      FooterColor = clWindow
      FooterFont.Charset = DEFAULT_CHARSET
      FooterFont.Color = clWindowText
      FooterFont.Height = -11
      FooterFont.Name = 'MS Sans Serif'
      FooterFont.Style = []
      Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit]
      OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghDblClickOptimizeColWidth, dghDialogFind, dghColumnResize, dghColumnMove]
      RowDetailPanel.Color = clBtnFace
      TabOrder = 0
      TitleFont.Charset = DEFAULT_CHARSET
      TitleFont.Color = clWindowText
      TitleFont.Height = -11
      TitleFont.Name = 'MS Sans Serif'
      TitleFont.Style = []
      UseMultiTitle = True
      VTitleMargin = 5
      OnKeyUp = dbgDogovorsKeyUp
      Columns = <
        item
          EditButtons = <>
          FieldName = 'ADDRESS'
          Footers = <>
          Width = 236
        end
        item
          EditButtons = <>
          FieldName = 'NAME'
          Footers = <>
        end
        item
          EditButtons = <>
          FieldName = 'SUMMA'
          Footers = <>
        end>
      object RowDetailData: TRowDetailPanelControlEh
      end
    end
    object ToolBar6: TToolBar
      Left = 2
      Top = 15
      Width = 494
      Height = 24
      Caption = 'ToolBar2'
      EdgeBorders = []
      Flat = True
      Images = MAIN.ImageList
      TabOrder = 1
      object ToolButton27: TToolButton
        Left = 0
        Top = 0
        Action = aDogAdd
      end
      object ToolButton29: TToolButton
        Left = 23
        Top = 0
        Width = 8
        Caption = 'ToolButton7'
        ImageIndex = 2
        Style = tbsSeparator
      end
      object ToolButton30: TToolButton
        Left = 31
        Top = 0
        Action = aDogDel
      end
    end
  end
  object pcMain: TPageControl [3]
    Left = 0
    Top = 29
    Width = 498
    Height = 220
    ActivePage = tsMain
    Align = alTop
    Style = tsFlatButtons
    TabOrder = 3
    object tsMain: TTabSheet
      Caption = #1054#1089#1085#1086#1074#1085#1099#1077' '#1089#1074#1086#1081#1089#1090#1074#1072
      object Label6: TLabel
        Left = 26
        Top = 11
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #8470' '#1072#1082#1090#1072
      end
      object Label5: TLabel
        Left = 26
        Top = 155
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1042#1077#1083#1080#1095#1080#1085#1072' (%)'
      end
      object Label1: TLabel
        Left = 26
        Top = 131
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1055#1077#1088#1080#1086#1076' '#1089
      end
      object Label2: TLabel
        Left = 192
        Top = 131
        Width = 23
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1087#1086
      end
      object Label3: TLabel
        Left = 26
        Top = 35
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1059#1089#1083#1091#1075#1072
      end
      object Label4: TLabel
        Left = 26
        Top = 59
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1055#1086#1089#1090#1072#1074#1097#1080#1082
      end
      object Label7: TLabel
        Left = 26
        Top = 83
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1059#1095#1072#1089#1090#1086#1082
      end
      object Label8: TLabel
        Left = 0
        Top = 107
        Width = 95
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1046#1080#1083#1080#1097#1085#1072#1103' '#1086#1088#1075'.'
      end
      object cbMeter: TDBCheckBoxEh
        Left = 224
        Top = 152
        Width = 97
        Height = 17
        AlwaysShowBorder = True
        Caption = #1087#1086' '#1089#1095#1077#1090#1095#1080#1082#1091
        DataField = 'PMETER'
        DataSource = dsc_IncompleteAct
        Flat = True
        TabOrder = 8
        ValueChecked = '1'
        ValueUnchecked = '0'
      end
      object lcbService: TDBLookupComboboxEh
        Left = 104
        Top = 33
        Width = 201
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NAME'
        ListSource = dsc_Group
        TabOrder = 1
        Visible = True
        OnChange = lcbServiceChange
      end
      object dbtBdate: TDBDateTimeEditEh
        Left = 104
        Top = 129
        Width = 81
        Height = 19
        AlwaysShowBorder = True
        DataField = 'BDATE'
        DataSource = dsc_IncompleteAct
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 5
        Visible = True
      end
      object dbtEdate: TDBDateTimeEditEh
        Left = 224
        Top = 129
        Width = 81
        Height = 19
        AlwaysShowBorder = True
        DataField = 'EDATE'
        DataSource = dsc_IncompleteAct
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 6
        Visible = True
      end
      object dbnIncomplete: TDBNumberEditEh
        Left = 104
        Top = 153
        Width = 81
        Height = 19
        AlwaysShowBorder = True
        DataField = 'IPERCENT'
        DataSource = dsc_IncompleteAct
        EditButtons = <>
        Flat = True
        MaxValue = 100.000000000000000000
        MinValue = -100.000000000000000000
        TabOrder = 7
        Visible = True
      end
      object cbNormativ: TDBCheckBoxEh
        Left = 224
        Top = 172
        Width = 97
        Height = 17
        AlwaysShowBorder = True
        Caption = #1087#1086' '#1085#1086#1088#1084#1072#1090#1080#1074#1091
        DataField = 'PNORM'
        DataSource = dsc_IncompleteAct
        Flat = True
        TabOrder = 9
        ValueChecked = '1'
        ValueUnchecked = '0'
      end
      object cbIs_Deleted: TDBCheckBoxEh
        Left = 244
        Top = 10
        Width = 61
        Height = 17
        AlwaysShowBorder = True
        Caption = #1091#1076#1072#1083#1077#1085#1072
        DataField = 'IS_DELETED'
        DataSource = dsc_IncompleteAct
        Flat = True
        TabOrder = 10
        ValueChecked = '1'
        ValueUnchecked = '0'
      end
      object dbeActNo: TDBEditEh
        Left = 104
        Top = 9
        Width = 129
        Height = 19
        AlwaysShowBorder = True
        DataField = 'ACT_NO'
        DataSource = dsc_IncompleteAct
        EditButtons = <>
        Flat = True
        TabOrder = 0
        Visible = True
      end
      object lcbSupplier: TDBLookupComboboxEh
        Left = 104
        Top = 57
        Width = 201
        Height = 19
        AlwaysShowBorder = True
        DataField = 'SUPPLIER_ID'
        DataSource = dsc_IncompleteAct
        DropDownBox.SpecRow.CellsText = '---'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NAME'
        ListSource = dsc_Supplier
        TabOrder = 2
        Visible = True
        OnChange = lcbSupplierChange
      end
      object lcbSuppDept: TDBLookupComboboxEh
        Left = 104
        Top = 81
        Width = 201
        Height = 19
        AlwaysShowBorder = True
        DataField = 'SUPPLIER_DEPT'
        DataSource = dsc_IncompleteAct
        DropDownBox.SpecRow.CellsText = '---'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NAME'
        ListSource = dsc_SuppDept
        TabOrder = 3
        Visible = True
      end
      object lcbManag: TDBLookupComboboxEh
        Left = 104
        Top = 105
        Width = 201
        Height = 19
        AlwaysShowBorder = True
        DataField = 'MANAG_ID'
        DataSource = dsc_IncompleteAct
        DropDownBox.SpecRow.CellsText = '---'
        DropDownBox.SpecRow.Visible = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'MANAG'
        ListSource = dsc_Manag
        TabOrder = 4
        Visible = True
      end
    end
    object tsAdditional: TTabSheet
      Caption = #1057#1083#1091#1078#1077#1073#1085#1099#1077' '#1076#1072#1085#1085#1099#1077
      ImageIndex = 1
      object Label27: TLabel
        Left = 42
        Top = 44
        Width = 77
        Height = 13
        Alignment = taRightJustify
        Caption = #1044#1072#1090#1072' '#1089#1086#1079#1076#1072#1085#1080#1103
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
      end
      object Label29: TLabel
        Left = 34
        Top = 100
        Width = 85
        Height = 13
        Alignment = taRightJustify
        Caption = #1044#1072#1090#1072' '#1080#1079#1084#1077#1085#1077#1085#1080#1103
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
      end
      object Label26: TLabel
        Left = 82
        Top = 16
        Width = 37
        Height = 13
        Alignment = taRightJustify
        Caption = #1057#1086#1079#1076#1072#1083
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
      end
      object Label28: TLabel
        Left = 73
        Top = 72
        Width = 46
        Height = 13
        Alignment = taRightJustify
        Caption = #1048#1079#1084#1077#1085#1080#1083
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
      end
      object Label42: TLabel
        Left = 102
        Top = 128
        Width = 17
        Height = 13
        Alignment = taRightJustify
        Caption = #1048#1044
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
      end
      object dbeCreater: TDBEditEh
        Left = 124
        Top = 12
        Width = 121
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Color = clInactiveCaptionText
        Ctl3D = True
        DataField = 'CREATER'
        DataSource = dsc_IncompleteAct
        EditButtons = <>
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        Flat = True
        ParentCtl3D = False
        ParentFont = False
        ReadOnly = True
        TabOrder = 0
        Visible = True
      end
      object dteModifyDate: TDBDateTimeEditEh
        Left = 124
        Top = 96
        Width = 121
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Color = clInactiveCaptionText
        DataField = 'MODIFYDATE'
        DataSource = dsc_IncompleteAct
        Enabled = False
        EditButtons = <>
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        Flat = True
        Kind = dtkDateEh
        ParentFont = False
        ReadOnly = True
        TabOrder = 1
        Visible = True
      end
      object dteCreateDate: TDBDateTimeEditEh
        Left = 124
        Top = 40
        Width = 121
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Color = clInactiveCaptionText
        DataField = 'CREATEDATE'
        DataSource = dsc_IncompleteAct
        Enabled = False
        EditButtons = <>
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        Flat = True
        Kind = dtkDateEh
        ParentFont = False
        ReadOnly = True
        TabOrder = 2
        Visible = True
      end
      object dbeID: TDBEditEh
        Left = 124
        Top = 124
        Width = 121
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Color = clInactiveCaptionText
        Ctl3D = True
        DataField = 'ID'
        DataSource = dsc_IncompleteAct
        EditButtons = <>
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        Flat = True
        ParentCtl3D = False
        ParentFont = False
        ReadOnly = True
        TabOrder = 3
        Visible = True
      end
      object dbeModifier: TDBEditEh
        Left = 124
        Top = 68
        Width = 121
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Color = clInactiveCaptionText
        Ctl3D = True
        DataField = 'MODIFIER'
        DataSource = dsc_IncompleteAct
        EditButtons = <>
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        Flat = True
        ParentCtl3D = False
        ParentFont = False
        ReadOnly = True
        TabOrder = 4
        Visible = True
      end
    end
  end
  inherited ActionList1: TActionList
    Images = MAIN.ImageList
    Left = 140
    Top = 4
    inherited aSave: TAction
      OnExecute = aSaveExecute
    end
    inherited aCancel: TAction
      OnExecute = aCancelExecute
    end
    object aDogAdd: TAction
      Caption = #1044#1086#1073#1072#1074#1080#1090#1100' '#1085#1077#1076#1086#1087#1086#1089#1090#1072#1074#1082#1091' '#1085#1072' '#1076#1086#1075#1086#1074#1086#1088#1099'...'
      Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1085#1077#1076#1086#1087#1086#1089#1090#1072#1074#1082#1091' '#1085#1072' '#1076#1086#1075#1086#1074#1086#1088#1099'...'
      ImageIndex = 9
      OnExecute = aDogAddExecute
    end
    object aDogDel: TAction
      Caption = #1059#1076#1072#1083#1080#1090#1100' '#1053#1077#1076#1086#1087#1086#1089#1090#1072#1074#1082#1091' '#1089' '#1076#1086#1075#1086#1074#1086#1088#1072'...'
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1053#1077#1076#1086#1087#1086#1089#1090#1072#1074#1082#1091' '#1089' '#1076#1086#1075#1086#1074#1086#1088#1072'...'
      ImageIndex = 2
      OnExecute = aDogDelExecute
    end
  end
  inherited PropStorage: TPropStorageEh
    Section = 'TcrdIncompleteAct'
    Left = 112
    Top = 4
  end
  object tr_AccDogovors: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 381
    Top = 39
  end
  object ds_IncompleteAct: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE D_INCOMPLETE_ACTS'
      'SET '
      '    ACT_NO = :ACT_NO,'
      '    PMETER = :PMETER,'
      '    PNORM = :PNORM,'
      '    BDATE = :BDATE,'
      '    EDATE = :EDATE,'
      '    IPERCENT = :IPERCENT,'
      '    IS_DELETED = :IS_DELETED,'
      '    SUPPLIER_ID = :SUPPLIER_ID,'
      '    SUPPLIER_DEPT = :SUPPLIER_DEPT,'
      '    MANAG_ID = MANAG_ID'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      'UPDATE D_INCOMPLETE_ACTS'
      'SET '
      '    IS_DELETED = 1'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO D_INCOMPLETE_ACTS('
      '    ID,'
      '    SUPPLIER_ID,'
      '    SUPPLIER_DEPT,'
      '    MANAG_ID,'
      '    ACT_NO,'
      '    PMETER,'
      '    PNORM,'
      '    IS_DELETED,'
      '    BDATE,'
      '    EDATE,'
      '    IPERCENT'
      ')'
      'VALUES('
      '    :ID,'
      '    :SUPPLIER_ID,'
      '    :SUPPLIER_DEPT,'
      '    :MANAG_ID,'
      '    :ACT_NO,'
      '    :PMETER,'
      '    :PNORM,'
      '    0,'
      '    :BDATE,'
      '    :EDATE,'
      '    :IPERCENT '
      ')')
    RefreshSQL.Strings = (
      'SELECT'
      '    ID,'
      '    SUPPLIER_ID,'
      '    SUPPLIER_DEPT,'
      '    MANAG_ID,'
      '    ACT_NO,'
      '    PMETER,'
      '    PNORM,'
      '    IS_DELETED,'
      '    BDATE,'
      '    EDATE,'
      '    IPERCENT,'
      '    CREATEDATE,'
      '    MODIFYDATE,'
      
        '    (select rname from user_getfullname (d.createuserid)) as cre' +
        'ater,'
      
        '    (select rname from user_getfullname (d.modifyuserid)) as mod' +
        'ifier'
      'FROM'
      '    D_INCOMPLETE_ACTS d'
      'where(  d.id = :pact_id'
      '     ) and (     D.ID = :OLD_ID'
      '     )'
      '    ')
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    SUPPLIER_ID,'
      '    SUPPLIER_DEPT,'
      '    MANAG_ID,'
      '    ACT_NO,'
      '    PMETER,'
      '    PNORM,'
      '    IS_DELETED,'
      '    BDATE,'
      '    EDATE,'
      '    IPERCENT,'
      '    CREATEDATE,'
      '    MODIFYDATE,'
      
        '    (select rname from user_getfullname (d.createuserid)) as cre' +
        'ater,'
      
        '    (select rname from user_getfullname (d.modifyuserid)) as mod' +
        'ifier'
      'FROM'
      '    D_INCOMPLETE_ACTS d'
      'where d.id = :pact_id')
    AutoUpdateOptions.UpdateTableName = 'D_INCOMPLETE_ACTS'
    AutoUpdateOptions.KeyFields = 'ID'
    AutoUpdateOptions.GeneratorName = 'GEN_D_INCOMPLETE_ACTS_ID'
    AutoUpdateOptions.WhenGetGenID = wgOnNewRecord
    Transaction = tr_AccDogovors
    Database = MAINDM.pMainDatabase
    UpdateTransaction = trUpdate
    Left = 415
    Top = 39
    object ds_IncompleteActID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_IncompleteActSUPPLIER_ID: TFIBIntegerField
      FieldName = 'SUPPLIER_ID'
    end
    object ds_IncompleteActSUPPLIER_DEPT: TFIBIntegerField
      FieldName = 'SUPPLIER_DEPT'
    end
    object ds_IncompleteActMANAG_ID: TFIBIntegerField
      FieldName = 'MANAG_ID'
    end
    object ds_IncompleteActACT_NO: TFIBStringField
      FieldName = 'ACT_NO'
      Size = 30
      EmptyStrToNull = True
    end
    object ds_IncompleteActPMETER: TFIBSmallIntField
      FieldName = 'PMETER'
    end
    object ds_IncompleteActPNORM: TFIBSmallIntField
      FieldName = 'PNORM'
    end
    object ds_IncompleteActIS_DELETED: TFIBSmallIntField
      FieldName = 'IS_DELETED'
    end
    object ds_IncompleteActBDATE: TFIBDateField
      FieldName = 'BDATE'
    end
    object ds_IncompleteActEDATE: TFIBDateField
      FieldName = 'EDATE'
    end
    object ds_IncompleteActIPERCENT: TFIBBCDField
      FieldName = 'IPERCENT'
      Size = 2
      RoundByScale = True
    end
    object ds_IncompleteActCREATEDATE: TFIBDateField
      FieldName = 'CREATEDATE'
    end
    object ds_IncompleteActMODIFYDATE: TFIBDateField
      FieldName = 'MODIFYDATE'
    end
    object ds_IncompleteActCREATER: TFIBStringField
      FieldName = 'CREATER'
      Size = 150
      EmptyStrToNull = True
    end
    object ds_IncompleteActMODIFIER: TFIBStringField
      FieldName = 'MODIFIER'
      Size = 150
      EmptyStrToNull = True
    end
  end
  object dsc_IncompleteAct: TDataSource
    DataSet = ds_IncompleteAct
    Left = 447
    Top = 39
  end
  object ds_Dogovors: TpFIBDataSet
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    D_INC2DOGOVORS'
      'WHERE'
      '        ID = :OLD_ID'
      '    ')
    RefreshSQL.Strings = (
      'select v.address, v.name,'
      
        '       (select sum(rsumma) from proc_incomplete_get_charges(:pac' +
        't_id, d.id)) as summa,'
      '       did.id'
      '  from d_inc2dogovors did'
      '  join dogovors d on d.id = did.dogovor_id'
      '  join v_abons v on v.id = d.abonent_id'
      '  where did.d_inc_act_id = :pact_id'
      '    and DID.ID = :OLD_ID'
      '     '
      '    ')
    SelectSQL.Strings = (
      'select v.address, v.name,'
      
        '       (select sum(rsumma) from proc_incomplete_get_charges(:pac' +
        't_id, d.id)) as summa,'
      '       did.id'
      '  from d_inc2dogovors did'
      '  join dogovors d on d.id = did.dogovor_id'
      '  join v_abons v on v.id = d.abonent_id'
      '  where did.d_inc_act_id = :pact_id'
      'order by 1,2')
    BeforeOpen = ds_DogovorsBeforeOpen
    Transaction = trUpdate
    Database = MAINDM.pMainDatabase
    Left = 115
    Top = 319
    oRefreshDeletedRecord = True
    object ds_DogovorsADDRESS: TFIBStringField
      DisplayLabel = #1040#1076#1088#1077#1089
      DisplayWidth = 30
      FieldName = 'ADDRESS'
      Size = 245
      EmptyStrToNull = True
    end
    object ds_DogovorsNAME: TFIBStringField
      DisplayLabel = #1060#1048#1054
      DisplayWidth = 30
      FieldName = 'NAME'
      Size = 120
      EmptyStrToNull = True
    end
    object ds_DogovorsSUMMA: TFIBBCDField
      DisplayLabel = #1057#1091#1084#1084#1072
      FieldName = 'SUMMA'
      Size = 2
      RoundByScale = True
    end
    object ds_DogovorsID: TFIBIntegerField
      FieldName = 'ID'
    end
  end
  object dsc_Dogovors: TDataSource
    DataSet = ds_Dogovors
    Left = 147
    Top = 319
  end
  object ds_Group: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME'
      'FROM'
      '    SERVICES s0'
      'where GROUP_ID = 0'
      '  and exists(select 1 from dogovors d, services s '
      '        where s.id = d.service_id and s.group_id = s0.id)'
      'order by 2')
    Transaction = MAINDM.pMainTransaction
    Database = MAINDM.pMainDatabase
    UpdateTransaction = trUpdate
    Left = 416
    Top = 68
    poSQLINT64ToBCD = True
    object ds_GroupID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_GroupNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 120
      EmptyStrToNull = True
    end
  end
  object dsc_Group: TDataSource
    DataSet = ds_Group
    Left = 448
    Top = 68
  end
  object ds_Supplier: TpFIBDataSet
    SelectSQL.Strings = (
      'select distinct'
      '    v.id,'
      '    v.name'
      'from v_supplier v'
      'join services s on s.group_id = :pgroup_id'
      'where exists(select 1 from dogovors d'
      '        where d.supplier_id = v.id'
      '          and s.id = d.service_id)'
      'order by 2')
    Database = MAINDM.pMainDatabase
    UpdateTransaction = trUpdate
    Left = 416
    Top = 96
    poSQLINT64ToBCD = True
    object ds_SupplierID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_SupplierNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dsc_Supplier: TDataSource
    DataSet = ds_Supplier
    Left = 448
    Top = 96
  end
  object ds_SuppDept: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME'
      'FROM'
      '    RSUPPLIER_DEPS r'
      'where SUPPLIER_ID = :Supplier_ID'
      
        '  and exists(select 1 from dogovors d where d.supplier_id = r.SU' +
        'PPLIER_ID'
      '        and r.id = d.supplier_dept)'
      'order by 2')
    Database = MAINDM.pMainDatabase
    UpdateTransaction = trUpdate
    Left = 416
    Top = 124
    poSQLINT64ToBCD = True
    object ds_SuppDeptID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_SuppDeptNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dsc_SuppDept: TDataSource
    DataSet = ds_SuppDept
    Left = 448
    Top = 124
  end
  object ds_Manag: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    MANAG'
      'FROM'
      '    RMANAG m'
      'where exists(select 1 from dogovors d where d.manag_id = m.id)'
      'order by 2')
    Database = MAINDM.pMainDatabase
    UpdateTransaction = trUpdate
    Left = 416
    Top = 152
    poSQLINT64ToBCD = True
    object ds_ManagID: TFIBIntegerField
      FieldName = 'ID'
    end
    object ds_ManagMANAG: TFIBStringField
      FieldName = 'MANAG'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dsc_Manag: TDataSource
    DataSet = ds_Manag
    Left = 448
    Top = 152
  end
  object trUpdate: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 417
    Top = 183
  end
end
